package com.zhiqihang.ziqihangservercourse.controller;

import com.zhiqihang.api.CourseApi;

import com.zhiqihang.result.JsonResult;
import com.zhiqihang.ziqihangservercourse.service.CourseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName CourseController
 * @Description Violet
 * @Author 86183
 * @Date 2024/7/26 17:26
 * @Version 1.0
 */
@RestController
@RequestMapping("/v1/course/")
@Slf4j
public class CourseController implements CourseApi {

    @Autowired
    private CourseService courseService;

    @GetMapping("findById/{id}")
    public JsonResult findById(@PathVariable("id") Long id) {
        log.debug("findById:{}",id);
        return courseService.findById(id);
    }

}
